<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery/jquery.min.js"></script>
    <script>
        //添加事件
        $(function () {
            $("#btn1").click(function () {
                //查询一个请求
                $.get("/employees/1",function (data) {
                    console.log(data);
                })
            })
            $("#btn2").click(function () {
                //查询列表请求
                $.get("/employees",function (data) {
                    console.log(data);
                })
            })
            $("#btn3").click(function () {
                //修改,用put
                $.ajax({
                    url:"/employees",
                    type:"put",
                    data:{id:3,name:"赵六",age:25},
                    success:function (data) {
                        console.log(data);
                    }})
            })
            $("#btn4").click(function () {
                //添加,用post
                $.post("/employees",{name:"赵六",age:25},function (data) {
                    console.log(data);
                })
            })
            $("#btn5").click(function () {
                //删除用delete
                $.ajax({
                    url:"employees/5",
                    type:"delete",
                    success:function (data) {
                        console.log(data)
                    }
                })
            })
        })
    </script>
</head>
<body>
<!--三个按钮-->
<button id="btn1" >查询一个</button>
<button id="btn2" >查询列表</button>
<button id="btn3" >修改</button>
<button id="btn4" >添加</button>
<button id="btn5" >删除</button>

</body>
</html>